package com.atguigu.gmall.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class LoginController {

    @GetMapping("login.html")
    public String login(HttpServletRequest request){
        //originalUrl记录用户从什么位置点击到登录的
        String originalUrl = request.getParameter("originalUrl");
        //我们需要在后台存储originalUrl 因为页面需要[[${originalUrl}]]
        request.setAttribute("originalUrl",originalUrl);
        //返回到登录页面
        return "login";
    }
}

